#ifndef TOOL_H
#define TOOL_H

#include <QApplication>
#include <qvariant.h>

#define ROOT_PATH QApplication::applicationDirPath()
#define APP_PATH QApplication::applicationFilePath()

class tool
{
public:
    tool();
};

QVariant getSetting(QString key, QString filename="config.ini");

void commitSetting(QString key, QVariant value, QString filename="config.ini");

QString getSn();

QString getHostMacAddress();

QString execShell(QString cmd);

void writeFile(QString text, QString fileName);

QString readFile(QString fileName);

void writeLog(const QString &message);

QString logD(const QString &message);
QString logW(const QString &message);
QString logE(const QString &message);
void clearLog();
#endif // TOOL_H
